package com.likeyoudo.common.core;

import java.util.Map;

import cn.hutool.core.util.StrUtil;
import okhttp3.RequestBody;

/**
 * @author LikeYouDo
 * @date 2023/12/20 23:36
 */
public abstract class BaseApi {
    public abstract void list(Map<String,String> queryParams);

    public abstract void get(String pathParams);

    public abstract void add(RequestBody data);

    public abstract void update(RequestBody data);

    public abstract void delete(String id);

    private String getClassName() {
        return this.getClass().getSimpleName();
    }

    public String listMsgType() {
        return StrUtil.format("{}.{}", this.getClassName(), "list");
    }

    public String getMsgType() {
        return StrUtil.format("{}.{}", this.getClassName(), "get");
    }

    public String addMsgType() {
        return StrUtil.format("{}.{}", this.getClassName(), "add");
    }

    public String updateMsgType() {
        return StrUtil.format("{}.{}", this.getClassName(), "update");
    }

    public String deleteMsgType() {
        return StrUtil.format("{}.{}", this.getClassName(), "delete");
    }


}
